Skip to content

test: add 7 test files covering uncovered code paths - #302

Merged
wyu71 merged 1 commit into
linuxdeepin:masterfrom
wyu71:agent/ut-bot/ae5d7574eed4
Nov 27, 2026
Merged

wyu71 merged 1 commit into
linuxdeepin:masterfrom
wyu71:agent/ut-bot/ae5d7574eed4

Conversation

@wyu71

@wyu71 wyu71 commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add 7 unit test files (30 test cases total) covering lcov-uncovered branches in cgraphicsview.cpp, idrawtool.cpp, and cmasicotool.cpp.

Test Files

File Target Lines Coverage
test_pageview_textundo_redo.cpp 1296-1299, 1307-1310 slotOnTextUndo/slotOnTextRedo with text item in edit state
test_pageview_contextmenu_ext.cpp 795-797, 1619-1621 contextMenuEvent shield branch, setTextAlignMenuActionStatus else branch
test_pageview_alignment_dynlayer.cpp 1548-1550, 1507 alignmentMovPos default (AlignCenter), updateSelectedItemsAlignment JDynamicLayer branch
test_pageview_eventfilter_gesture.cpp 1697-1724, 1757 eventFilter space+drag scroll, gestureEvent → pinchTriggered
test_idrawtool_dblclick.cpp 177-191, 253-254, 560-583 mouseDoubleClickEvent branches, dueTouchDoubleClickedStart touch/mouse double-click
test_idrawtool_touchfinish.cpp 460-463, 355-360, 381-384 toolDoFinish cache disable, toolDoUpdate touch sensitivity radius
test_cmasicotool_groups.cpp 88-94, 132-137, 244-247, 332-336 getBlurEnableItems group, saveItemZValue group recursion, blur tool flows

Verification

All 30 new test cases pass under QT_QPA_PLATFORM=offscreen. Existing tests continue to pass.

Summary by Sourcery

Expand unit-test coverage across uncovered graphics-view and drawing-tool code paths.

Tests:

  • Add seven unit-test suites covering previously untested PageView, IDrawTool, and IBlurTool branches, including text editing, context menus, alignment, gestures, double-click handling, touch behavior, grouping, and blur flows.
  • Verify the new tests pass in offscreen mode alongside the existing test suite.

@sourcery-ai

sourcery-ai Bot commented Nov 27, 2026

Copy link
Copy Markdown

Sorry @wyu71, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 5 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

Add unit tests for deepin-draw covering lcov-uncovered branches across
cgraphicsview.cpp, idrawtool.cpp, and cmasicotool.cpp:
- test_pageview_textundo_redo.cpp: slotOnTextUndo/Redo with text item
  in edit state (lines 1296-1299, 1307-1310)
- test_pageview_contextmenu_ext.cpp: contextMenuEvent shield branch
  (lines 795-797), setTextAlignMenuActionStatus else branch
  (lines 1619-1621)
- test_pageview_alignment_dynlayer.cpp: alignmentMovPos default branch
  with AlignCenter (lines 1548-1550), updateSelectedItemsAlignment
  JDynamicLayer branch (line 1507)
- test_pageview_eventfilter_gesture.cpp: eventFilter space+drag scroll
  (lines 1697-1724), gestureEvent pinchTriggered (line 1757)
- test_idrawtool_dblclick.cpp: mouseDoubleClickEvent synthesized and
  normal branches (lines 177-191), dueTouchDoubleClickedStart touch
  double-click (lines 253-254, 560-583)
- test_idrawtool_touchfinish.cpp: toolDoFinish cache disable
  (lines 460-463), toolDoUpdate touch sensitivity (lines 355-360, 381-384)
- test_cmasicotool_groups.cpp: getBlurEnableItems group branch
  (lines 88-94), saveItemZValue group recursion (lines 132-137),
  toolStart no-blur path (lines 244-247), toolFinish clearCommand
  (lines 332-336), JDynamicLayer blurBegin/blurEnd

Issue: V-9581
Log: add 7 test files covering uncovered code paths
@wyu71
wyu71 force-pushed the agent/ut-bot/ae5d7574eed4 branch from d954ac1 to d2f02cd Compare November 27, 2026 01:59
@sourcery-ai

sourcery-ai Bot commented Nov 27, 2026

Copy link
Copy Markdown

Reviewer's Guide

Tests

Test PageView text undo and redo behavior for text items both in and out of edit state.

  • tests/test_pageview_textundo_redo.cpp L1-161

Test context-menu suppression and text-alignment action states for auto-adjusting and fixed-size text items.

  • tests/test_pageview_contextmenu_ext.cpp L1-148

Test alignment calculations and selected-item alignment when a dynamic layer is present.

  • tests/test_pageview_alignment_dynlayer.cpp L1-121

Test space-drag scrolling and pinch-gesture handling in PageView.

  • tests/test_pageview_eventfilter_gesture.cpp L1-149

Test synthesized and normal mouse double-click handling, plus touch and mouse double-click detection in IDrawTool.

  • tests/test_idrawtool_dblclick.cpp L1-209

Test IDrawTool cache disabling on finish and touch-sensitivity behavior at different movement distances.

  • tests/test_idrawtool_touchfinish.cpp L1-204

Test blur-tool group item collection and z-value recursion, no-blur flows, and dynamic-layer blur lifecycle.

  • tests/test_cmasicotool_groups.cpp L1-308

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@wyu71 wyu71 changed the title test: add 7 test files covering uncovered code paths (V-9581) test: add 7 test files covering uncovered code paths Nov 27, 2026
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: lzwind, wyu71

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@wyu71
wyu71 merged commit fc6b566 into linuxdeepin:master Nov 27, 2026
14 of 15 checks passed
@wyu71
wyu71 deleted the agent/ut-bot/ae5d7574eed4 branch November 27, 2026 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants